// 获取随机数, 参数为最小值到最大值
function getRandom (min = 0, max = 1) {
	min = Math.floor(min)
	max = Math.floor(max)
  return Math.floor(Math.random() * (max - min) + min + 1)
}
// 获取DOM元素的兼容写法
function my$ (str) {
  var result = null
  switch (str[0]) {
    case '.':
      str = str.split('').slice(1).join('')
      var temp = document.getElementsByClassName(str)
      if (temp.length === 1) {
        return temp[0]
      } else {
        return temp
      }
      break
    case '#':
      str = str.split('').slice(1).join('')
      return document.getElementById(str)
      break
    default:
      var temp = document.getElementsByTagName(str)
      if (temp.length === 1) {
        return temp[0]
      } else {
        return temp
      }
  }
}
// 绑定事件的兼容函数
function bindEvent(ele, type, fn) {
  ele = ele || this
  if (ele.addEvenetListener) {
    ele.addEvenetListener(type, fn)
  } else if (ele.attachEvent) {
    ele.addachEvent('on' + type, fn)
  } else {
    ele['on' + type] = fn
  }
}
// export {
//   getRandom,
//   my$
// }